Skip to content

[hellojoyworldz] WEEK 02 solutions#2697

Merged
hellojoyworldz merged 9 commits into
DaleStudy:mainfrom
hellojoyworldz:main
Jul 4, 2026
Merged

[hellojoyworldz] WEEK 02 solutions#2697
hellojoyworldz merged 9 commits into
DaleStudy:mainfrom
hellojoyworldz:main

Conversation

@hellojoyworldz

@hellojoyworldz hellojoyworldz commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@dalestudy

dalestudy Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

📊 hellojoyworldz 님의 학습 현황

이번 주 제출 문제

문제 난이도 유형 분석
3sum Medium ✅ 의도한 유형
climbing-stairs Easy ✅ 의도한 유형
product-of-array-except-self Medium ✅ 의도한 유형
valid-anagram Easy ⚠️ 유형 불일치
validate-binary-search-tree Medium ✅ 의도한 유형

누적 학습 요약

  • 풀이한 문제: 5 / 75개
  • 이번 주 유형 일치율: 80% (5문제 중 4문제 일치)

문제 풀이 현황

카테고리 진행도 완료
Heap ■■□□□□□ 1 / 3 (Medium 1)
Array ■□□□□□□ 2 / 10 (Easy 2)
Graph ■□□□□□□ 1 / 8 (Medium 1)
Dynamic Programming ■□□□□□□ 1 / 11 (Medium 1)
Binary □□□□□□□ 0 / 5 ← 아직 시작 안 함
Interval □□□□□□□ 0 / 5 ← 아직 시작 안 함
Linked List □□□□□□□ 0 / 6 ← 아직 시작 안 함
Matrix □□□□□□□ 0 / 4 ← 아직 시작 안 함
String □□□□□□□ 0 / 10 ← 아직 시작 안 함
Tree □□□□□□□ 0 / 14 ← 아직 시작 안 함

🤖 이 댓글은 GitHub App을 통해 자동으로 작성되었습니다.

🔢 API 사용량 (gpt-5-nano)
요청 입력 토큰 출력 토큰 합계 비용
1 1,856 231 2,087 $0.000185

@parkhojeong parkhojeong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드가 간결해서 읽기 좋았던 거 같습니다. 수고하셨습니다~!

Comment on lines +5 to +8
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
return sorted(s) == sorted(t)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

간결하고 좋네요!

Comment on lines +19 to +21
for i in reversed(range(n)):
answer[i] *= right
right *= nums[i]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reversed(range(n)) 사용하신거 간결하고 좋네요~

prev2, prev1 = 1, 1
for _ in range(n - 1):
prev2, prev1 = prev1, prev2 + prev1
return prev1

@parkhojeong parkhojeong Jul 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

개인적으로는 이런 부분들이 읽으면서 생각을 한 번 더 하게 되었던 거 같습니다!

  • prev2, prev1에 1, 1 이 할당된 것도 문제의 조건과 어떻게 연결되는건지
  • n = 1, n = 2 일때 어떻게 처리되는지
  • prev1이 리턴하는게 n 값 까지 계산한 후 prev1 을 리턴하는 것인지

가독성을 고려한다면 배열을 사용해봐도 괜찮을 거 같습니다~

class Solution:
    def climbStairs(self, n: int) -> int:
        if n == 1:
            return 1

        arr = [0] * n
        arr[0], arr[1] = 1, 2

        for i in range(2, n):
            arr[i] = arr[i - 1] + arr[i - 2]

        return arr[-1]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안 그래도 가독성 부분이 고민이였는데,
제안해 주신 것처럼 배열을 쓰니까 흐름이 훨씬 직관적이고 좋네요!

Comment thread 3sum/hellojoyworldz.py
Comment on lines +13 to +15
for i in range(len(nums)):
if i > 0 and nums[i] == nums[i - 1]:
continue

@parkhojeong parkhojeong Jul 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정렬되어 있는 상태라 nums[i] > 0 인 부분은 break해도 좋을 거 같습니다!
ex. [-1, 0, 1, 2, 3, 4, 5, 6, 7], i = 2 부터는 양수 + 양수 + 양수

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 그러네요, 제가 놓쳤습니다
세심한 피드백 정말 감사합니다! 🙇‍♂️

Comment on lines +20 to +21
if not (low < node.val < high):
return False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(log < node.val < high) 사용하신거 좋네요!

@hellojoyworldz hellojoyworldz merged commit 33b974b into DaleStudy:main Jul 4, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Completed in 리트코드 스터디 8기 Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants